REPLICATION MATERIALS: Perceived Economic Contributions Increase Positivity toward Undocumented Immigrants

This repository contains all datasets, codebooks, and analysis scripts necessary to replicate the results presented in the article and supplementary material.

# Files

- **code.R**  
  Main replication script. Runs all analyses, tables, and figures reported in the article and supplementary material.

- **appb.rds**  
  Dataset for Appendix B analyses.  
  - Codebook: `appb_codebook.xlsx`

- **study1.rds**  
  Dataset for Study 1.  
  - Codebook: `study1_codebook.xlsx`

- **study2.rds**  
  Dataset for Study 2.  
  - Codebook: `study2_codebook.xlsx`

- **study3.rds**  
  Dataset for Study 3.  
  - Codebook: `study3_codebook.xlsx`

- **_codebook.xlsx files**  
  Each dataset has a corresponding Excel codebook describing variables and coding.

# Replication Instructions

1. Install **R (≥ 4.5.2)**.
2. Install the required R packages:

   install.packages(c(
     "tidyverse", "estimatr", "broom.helpers", "modelsummary",
     "marginaleffects", "kableExtra", "ggthemes", "patchwork", "ggh4x"
   ))

3. Place all datasets (`appb.rds`, `study1.rds`, `study2.rds`, `study3.rds`) in the same directory as `analysis.R`.
4. Open `analysis.R` in RStudio and run the script from top to bottom.

# Outputs

- All output is displayed in the RStudio Console.
- No files are written to disk by `analysis.R`.

# Notes

- Results were last executed under R 4.5.2 (2025-12-16) on Windows 11.
- Exact package versions used are listed at the bottom of `analysis.R`.